import Mock from "mockjs"
export default {
    getMenu: config =>{
        const {username,password} = JSON.parse(config.body)
        if(username === 'admin'&& password ==="admin"){
            return {
                code:20000,
                data:{
                    menu: [
                        {
                            path: '/home',
                            name: "home",
                            label: '首页',
                            icon: 's-home',
                            url: 'Home/index'
                        },
                        {
                            path: '/mall',
                            name: "mall",
                            label: '商品管理',
                            icon: 'video-play',
                            url: 'Mall/index'
                        },
                        {
                            path: '/O_User',
                            name: "user",
                            label: '用户管理',
                            icon: 'user',
                            url: 'User/index'
                        },
                       
                    ],
                   token:Mock.Random.guid(),
                   message:'获取成功' 
                }
            }
        }else if(username==='youke' && password==='youke'){
            return { 
                code:20000,
                data:{
                    menu: [
                        {
                            path: '/home',
                            name: "home",
                            label: '首页',
                            icon: 's-home',
                            url: 'Home/index'
                        },
                        {
                            path: '/mall',
                            name: "mall",
                            label: '商品管理',
                            icon: 'video-play',
                            url: 'Mall/index'
                        }],
                        token:Mock.Random.guid(),
                        message:'获取成功'
                }
            }
        }else{
            return {
                code:-999,
                data:{
                    message:'用户不存在'
                }
            }
        }


    }
}
